home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d13
/
pcroct89.arc
/
DAY.BAT
< prev
next >
Wrap
DOS Batch File
|
1990-03-21
|
1KB
|
29 lines
ECHO OFF
IF "%3"=="" GOTO HELP
IF "%2"=="1" GOTO HELP
IF "%2"=="2" GOTO HELP
:The next line is long. It starts with "ECHO" and ends with "| GWBASIC."
ECHO CLS:PRINT "%1 %2 %3 is"(%1+%1\4-%1\100+%1\400+2.6*%2+1.2+%3) MOD 7"'sday" | GWBASIC
GOTO END
:HELP
ECHO This program finds the day of the week for any date from year AD 1 to AD
ECHO 26000 using the Gregorian calendar we use today (which is only accurate
ECHO to AD 2800). To find the day of the week for 1989 May 11, enter:
ECHO\
ECHO DAY 1989 5 11
ECHO\
ECHO You must enter January as month 13 of the previous year, and
ECHO February as month 14 of the previous year. To interpret the output:
ECHO\
ECHO Sunday is 0'sday
ECHO Monday is 1'sday
ECHO Tuesday is 2'sday (mnemonic)
ECHO Wednesday is 3'sday
ECHO Thursday is 4'sday
ECHO Friday is 5'sday
ECHO Saturday is 6'sday
ECHO\
ECHO For common (non-leap) years, February 29 and March 1 return the same
ECHO answer. For leap years, they return sequential days of the week.
:END